package de.tum.in.far.threedui.superbrickball.gui;

import javax.media.j3d.Appearance;
import javax.media.j3d.TransformGroup;

import com.sun.j3d.utils.geometry.Primitive;
import com.sun.j3d.utils.geometry.Sphere;

import de.tum.in.far.threedui.general.TransformableObject;

public class SphereObject extends TransformableObject {

	private float radius;

	public SphereObject(float radius, Appearance app) {
		this.radius = radius;
		Sphere sphere = new Sphere(radius, Primitive.GENERATE_NORMALS +

		Primitive.GENERATE_TEXTURE_COORDS, app);
		transGroup.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
		transGroup.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
		transGroup.setCapability(TransformGroup.ALLOW_CHILDREN_EXTEND);
		transGroup.addChild(sphere);
	}

	public float getRadius() {
		return this.radius;
	}

}
